package com.dengjiawen.project01.bag;

/**
 * Statement the required methods and fields.and be impl MyObjectListImpl.
 * MyObjectListImpl class in the impl folder.
 *
 * @author Jarvan
 * @version 1.0
 * @create 2020/9/22 20:58
 */
public interface MyObjectList {


    /**
     * Add an item to the end of the list of this bag
     *
     * @param insertObject insert object.
     * @return insert Object.
     */
    Object insert(Object insertObject);

    /**
     * Remove the item at the end of this bag
     *
     * @return the Object that been removed.
     */
    Object removeLast();

    /**
     * Remove an item at a random index from this bag
     *
     * @return the Object that been removed.
     */
    Object removeRandom();

    /**
     * Remove the item by the index of the array.
     *
     * @param indexOfObjectArrays index of tne array
     * @return the Object that been removed.
     */
    Object removeByIndex(int indexOfObjectArrays);

    /**
     * Get a get(a reference to an item)
     *
     * @param object object.
     * @return get(a reference to an item)
     */
    int getIndex(Object object);

    /**
     * Get a Object from the array object by index.
     *
     * @param index index.
     * @return a Object from the array object by index.
     */
    Object getObject(int index);

    /**
     * Check how many items are there in this bag
     *
     * @return number of the items.
     */
    int size();

    /**
     * Check to see if this bag is empty
     *
     * @return true if the array of object is empty,and false if No
     */
    boolean isEmpty();

    /**
     * Empty this bag,if the array of object has any items ,clean up the array.
     */
    void makeEmpty();
}





















